// pages/forward/forwardlog.js
var util = require('../../utils/util.js');
const app = getApp()
var page = 1;
Page({

    /**
     * 页面的初始数据
     */
    data: {
        rlogs: [],
        loading: true,
        showView: false
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },
    //滚动到底部刷新
    onReachBottom: function () {
       // this.getForwardlog();
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        page = 1;
        this.getForwardlog();
    },
    //获取企业信息
    getForwardlog: function () {
        var that = this;
        var uid = wx.getStorageSync('userId');
        var limit = 500;
        wx.request({
            url: app.globalData.hostUrl + 'member/forwardlog',
            data: {
                page: page,
                limit: limit,
                uid: uid
            },
            success: function (res) {
              if (res.data.result) {
                    page++
                    that.setData({
                      rlogs: that.data.rlogs.concat(res.data.result)
                    });
                    if (res.data.result.length < limit) {
                        that.setData({
                            loading: false
                        })
                    }
                }
                else {
                    that.setData({
                        loading: false
                    })
                    return false
                }
            }
        })
    }
})